package com.bazaaroid.server.gae.core.dto.partner;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import com.bazaaroid.server.gae.core.persistence.model.partner.Location;

@XmlRootElement(name = "Location")
public class LocationDTO {

	private Location location = null;

	public LocationDTO(){}

	public LocationDTO(Location location) {
		this.location = location;
	}

	@XmlElement
	public String getKey() {
		return location.getKey().toString();
	}

	@XmlElement
	public String getName() {
		return location.getName();
	}

	@XmlElement
	public AddressDTO getAddress() {
		return new AddressDTO(location.getAddress());
	}

	@XmlElement
	public String getImagePath() {
		return location.getImagePath();
	}

	@XmlElement
	public GeoPtDTO getGeoPt() {
		return location.getGeoPoint() != null
			? new GeoPtDTO(location.getGeoPoint())
			: null;
	}

	@XmlElement
	public String getOpeningHours() {
		return location.getOpeningHours();
	}

}
